package com.duan.laugh.upms.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.duan.laugh.upms.api.pojo.entity.Role;
import com.duan.laugh.upms.mapper.RoleMapper;
import com.duan.laugh.upms.service.RoleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 角色service实现
 *
 * @author duanjw
 */
@Slf4j
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements RoleService {

    /**
     * 根据通行证id查询角色
     *
     * @param passId
     * @return
     */
    @Override
    public List<Role> selectRoleByPassId(Long passId) {
        return baseMapper.selectRoleByPassId(passId);
    }

    /**
     * 查询当前用户的所有租户
     *
     * @param userId
     * @return
     */
    @Override
    public List<Long> selectTenantByUserIdAndClientId(Long userId, String clientId) {
        return baseMapper.selectTenantByUserIdAndClientId(userId, clientId);
    }
}
